package com.yunhe.marketing.service;

import com.alibaba.fastjson.JSONObject;
import com.yunhe.common.exception.ArgumentErrorException;
import com.yunhe.common.model.mybatis.PageResult;
import com.yunhe.common.exception.UniqueConstraintsException;
import com.yunhe.marketing.domain.Enterprise;
import com.yunhe.marketing.domain.FilterCondition;
import com.yunhe.marketing.model.ClueFilterCondition;

import java.text.ParseException;
import java.util.List;

/**
 * @ClassName: IClueRepositoryService
 * @Description:
 * @author: GongDaCheng
 * @Date: 10:09 2021/2/24
 */
public interface IClueRepositoryService {
    /**
     * @Description 根据条件筛选线索（根据ClueQueryCondition筛选，传入参数为ClueFilterCondition，在Service中进行转换）
     * @Param ClueFilterCondition
     * @Return List<Enterprise>
     * @Date 2021/2/25 15:28
     */
    PageResult selectClueByClueQueryCondition(ClueFilterCondition clueFilterCondition , int page , int size) throws ParseException;

    /**
     * @Description 保存线索筛选条件
     * @Param String conditionName, ClueQueryCondition
     * @Return int
     * @Date 2021/2/25 17:32
     */
    FilterCondition saveClueFilterCondition(Long userId , String conditionName , ClueFilterCondition clueFilterCondition) throws UniqueConstraintsException;

    /**
     * @Description 查看已保存的条件组
     * @Param Long userId
     * @Return List<FilterCondition>
     * @Date 2021/2/26 14:06
     */
    PageResult viewSavedFilterCondition(Long userId ,int page, int size);

    /**
     * @Description 根据关键字搜索条件组
     * @Param Long userId, String keyName
     * @Return List<FilterCondition>
     * @Date 2021/2/26 14:07
     */
    PageResult selectFilterConditionByKeyName(Long userId, String keyName, int page, int size);

    /**
     * @Description 根据条件组名字获得条件组
     * @Param Long userId, String conditionName
     * @Return FilterCondition
     * @Date 2021/2/26 14:44
     */
    FilterCondition selectFilterConditionByConditionName(Long userId, String conditionName);

    /**
     * @Description 根据条件组ID删除条件组
     * @Param Long id
     * @Return int
     * @Date 2021/2/26 14:48
     */
    int deleteById(Long id);

    /**
     * 分配任务
     * @param ids 导出的企业id
     * @param responsiblePersonId 负责人的id
     * @return java.util.List<com.yunhe.marketing.domain.Enterprise>
     * @create 2021/2/26 15:57
     */
    List<Enterprise> assign(String ids , Long responsiblePersonId) throws ArgumentErrorException;

    /**
     * @Description 根据企业id查询线索（查看线索详情）
     * @Param Long id
     * @Return Enterprise
     * @Date 2021/2/26 17:14
     */
    Enterprise selectClueById(Long id);

    /**
     * @Description 根据条件组名字获得条件组
     * @Param Long userId, String conditionName
     * @Return FilterCondition
     * @Date 2021/2/26 14:44
     */
    FilterCondition selectFilterConditionByConditionId(Long conditionId);
}
